package com.example.demo.pattern.proxypattern;

import java.lang.reflect.Proxy;

public class Start {
    public static void main(String[] args) {
        PersonBean personBean = new PersonBeanImpl();
        PersonBean personBean1 = InvocationHandlerFactory.getOwnerPersonBeanProxy(personBean);
        personBean1.getName();
//        personBean1.setName("name1");

        //可以用这个方法判断是不是代理对象
        System.out.println(Proxy.isProxyClass(personBean.getClass()));
        System.out.println(Proxy.isProxyClass(personBean1.getClass()));
    }
}
